<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class M9_good extends Model
{
    //指定表名
    protected $table = 'goods';
    //取消时间
    public $timestamps = false;
    //定义主键
    protected $primaryKey = 'gid';
    protected $fillable = ['gname','g_cid','gfeature','gcost','gnum','gphoto','gcontent'];

    /**
     * 获取拥有此商品的分类。
     */
    public function cate()
    {
        return $this->belongsTo('App\Model\M9_cate','g_cid','cid');
    }
}
